package com.bigcat.gulimall.demo.test;

import org.springframework.util.StringUtils;

/**
 * @author sufer_yuan
 * @since 2022/10/11
 */
public class test3 {
    public static void main(String[] args) {
        String cordinate = ",";
//        cordinate = cordinate.trim();
        String realCoordinate = StringUtils.hasText(cordinate) && cordinate.contains(",") ? cordinate : "0,0";
        String[] coordinateStr = realCoordinate.split(",");
        System.out.println(realCoordinate);

        try {
            System.out.println(Double.parseDouble(coordinateStr[0]));
            System.out.println(Double.parseDouble(coordinateStr[1]));
        } catch (Exception e) {
            System.out.println(e);
        }

        System.out.println(coordinateStr.length);
        for (String s : coordinateStr) {
            System.out.println(s);
        }

        Double lon = 1.2322229051;
        String lonStr = String.valueOf(lon);
        System.out.println(lon.toString());
        System.out.println(lon + "");
    }
}
